<%@page import="com.iflysse.bbs.model.ReplyInfo"%>
<%@page import="java.util.List"%>
<%@page import="com.iflysse.bbs.dao.impl.ReplyDaoImpl"%>
<%@page import="com.iflysse.bbs.dao.ReplyDao"%>
<%@page import="com.iflysse.bbs.model.NewsInfo"%>
<%@page import="com.iflysse.bbs.dao.impl.NewsDaoImpl"%>
<%@page import="com.iflysse.bbs.dao.NewsDao"%>
<%@page import="com.iflysse.bbs.model.UserInfo"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
	String newsid = null; 
	
	if(request.getParameter("newsid") == null){
		response.sendRedirect("../index_handler.jsp");
		return;
	}
	newsid = request.getParameter("newsid").toString();
	
	//获取新闻
	NewsDao newsDao = new NewsDaoImpl();
	NewsInfo newsInfo = newsDao.getNewsInfo(Integer.valueOf(newsid).intValue());
	
	//获取评论
	ReplyDao replyDao = new ReplyDaoImpl();
	List<ReplyInfo> replyList = replyDao.getReplyListByNewsId(Integer.valueOf(newsid).intValue());
	
	request.setAttribute("newsInfo", newsInfo);
	request.setAttribute("replyList", replyList);
	
	request.getRequestDispatcher("/pages/view.jsp").forward(request, response);
%>